Meteor.publish 'orders', ->
	unless this.userId
		return this.ready()

	console.log '[publish] orders'.green

	if RocketChat.authz.hasPermission(@userId, 'view-room-administration') isnt true
		query =
			owner:this.userId
	else
		query={}
	Order.find query,
		fields:
			username: 1
			mobile: 1
			idnumber:1
			tdate: 1
			startstation:1
			endstation:1
			trainnumber:1
			trainlevel:1
			status:1
			createdAt:1
			ownername:1

